Learn R Programming

easyRNASeq (version 2.8.2)

ShortRead additional methods: Methods extending the ShortRead package functionalities

Description

These are functions extending the ShortRead packages capabilities:

Usage

demultiplex(obj,barcodes=c(),barcodes.qty=12,barcode.length=6,
edition.dist=2,type=c("independant","within"),index.only=FALSE,mc.cores=1L)
barcodePlot(obj,barcodes=c(),type=c("independant","within"),
barcode.length=6,show.barcode=20,...)
chastityFilter(.name="Illumina Chastity Filter")
naPositionFilter(.name="NA Position Filter")

Arguments

obj
An object derived from class AlignedRead
barcodes
A character vector describing the multiplex (i.e. barcode) sequences used in the experiment.
barcodes.qty
An integer describing the number of barcodes
barcode.length
An integer describing the barcode length in bp
edition.dist
The maximal edition distance (i.e. the number of changes to apply), to accept an incorrectly sequenced barcode.
type
The type of barcode used. independent represents barcodes generated by the illumina protocol; i.e. a separate additional sequencing step performed once the first mate has been sequenced. within represents barcodes that are part of the sequenced reads as established by Lefrancois P et al., BMC Genomics, 2009
index.only
simply return the index and not the barcode themselves.
mc.cores
A parameter ultimately passed to srdistance to enable parallel processing on mc.cores. On linux and Mac only, windows task remain serially processed.
.name
An internal string describing the filter
show.barcode
An integer specifying how many barcodes should be displayed in the final output.
...
additional graphic parameters

Value

    • barcodePlotreturns invisibly the barcode frequencies.
    • chastityFilterreturns aSRFilterinstance.
    • demultiplexreturns a list ofAlignedReadobjects.
    • naPositionFilterreturns aSRFilterinstance.

Details

  • barcodePlotCreates a plot showing the barcode distribution of a multiplexed sequencing library.
  • chastityFilterCreates aSRFilterinstance that filters SolexaExport read according to the chastity filtering value.
  • demultiplexSplit a singleAlignedReadobject into a list ofAlignedReadobjects according to the barcodes provided by the user. It supports multicore processing but has a default serial behaviour.
  • naPositionFilterCreates aSRFilterinstance that filters SolexaExport read having an NA position.

When demultiplexing, the function if provided with just the AlignedRead will try to find out how many barcodes were used and what they are. This is unwise to do as many barcodes will get wrongly sequenced and not always the most frequent ones are the one you used! It's therefore strongly advised to specify the barcodes' sequences that were used.

See Also

SRFilter AlignedRead

Examples

Run this code
## the barcode
	barcodes=c("ACACTG","ACTAGC","ATGGCT","TTGCGA")

	## the multiplexed data
	alns <- readAligned(
                    system.file(
                                "extdata",
                                package="RnaSeqTutorial"),
                    pattern="multiplex_export",
                    filter=compose(
                      chastityFilter(),
                      nFilter(2),
                      chromosomeFilter(regex="chr")),
                    type="SolexaExport",
                    withAll=TRUE)

	## barcode plot
	barcodePlot(alns,
            barcodes=barcodes,
            type="within",
            barcode.length=6,
            show.barcode=20,
            main="All samples",
            xlim=c(0,0.5))

	## demultiplexing
	dem.alns <- demultiplex(alns,
                        barcodes=barcodes,
                        edition.dist=2,
                        barcodes.qty=4,
                        type="within")

	## plotting again
	par(mfrow=c(2,2))
	barcode.frequencies <- lapply(
                              names(dem.alns$barcodes),
                              function(barcode,alns){
                                barcodePlot(
                                            alns$barcodes[[barcode]],
                                            barcodes=barcode,
                                            type="within",barcode.length=6,
                                            show.barcode=20,
                                            main=paste(
                                              "Expected barcode:",
                                              barcode))
                              },dem.alns)

Run the code above in your browser using DataLab